#include <stdio.h>

int main(void)
{

    int year, month, day;
    scanf("%d%d%d", &year, &month, &day);

    int res = 0;

    switch (month) {
		case 12:  res += 30;    
		case 11:  res += 31;   
		case 10:  res += 30;      
		case  9:  res += 31; 
		case  8:  res += 31; 
		case  7:  res += 30;
		case  6:  res += 31; 
		case  5:  res += 30;
		case  4:  res += 31; 
		case  3:  res += 28;      
		case  2:  res += 31;      
		case  1:  res += day;     
	}

	if ((year % 4 == 0 && year % 100 != 0 || year % 400 == 0) && month >= 3) 
        res++;
	
    printf("%d年%d月%d日是这一年的第%d天\n", year, month, day, res);
    return 0;
}




